package com.server.model.enums;

/**
 * Description: This is a sample class.
 * @Author Simon
 */

public enum ExceptionInfo {

    SUCCESS(0, "ok"),
    PARAMS_ERROR(40000, "请求参数错误"),
    NOT_LOGIN_ERROR(40100, "未登录"),
    NO_AUTH_ERROR(40101, "无权限"),
    FILE_EXISTED(40200,"文件已存在"),
    FILE_REQUEST_FAILED(40201,"文件修改失败"),
    FILE_NOT_EXISTED(40202,"文件不存在"),
    NOT_FOUND_ERROR(40400, "请求数据不存在"),
    FORBIDDEN_ERROR(40300, "禁止访问"),
    SYSTEM_ERROR(50000, "系统内部异常"),
    OPERATION_ERROR(50001, "操作失败"),
    RULE_READ_FAILED(60001,"文件读取失败"),
    MVEL_RULE_FACTORY_LOAD_FAILED(60020,"MvelRuleFactory未加载"),
    CONNECT_TO_AUTH_FAILED(70001,"连接到Auth中心失败"),
    SERIALIZATION_FAILED(70002,"序列化失败"),
    DESERIALIZATION_FAILED(70003,"反序列化失败"),
    SERIALIZE_ALGORITHM_UNSUPPORTED(70004,"序列化算法不支持");
    /**
     * 状态码
     */
    private final int code;

    /**
     * 信息
     */
    private final String message;

    ExceptionInfo(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
